﻿using SupportLayer.Objetos.Produto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SupportLayer.ExtensionMethods
{
	public static class Objects
	{
		public static string getMessage(this Exception ex)
		{
			if (ex.Message.Contains("inner exception"))
				if (ex.InnerException.Message.Contains("inner exception"))
					return ex.InnerException.InnerException.Message;
				else
					return ex.InnerException.Message;
			else
				return ex.Message;
		}
	}
}
